package de.zefania.api;

import org.w3c.dom.Document;

/**
 * represents one bible modul
 * @author Thomas
 *
 */
public interface BibleModul {
	
	/**
	 * returns the hash the modul is identified with internally
	 * @return a hash string
	 */
	String getDigest();
	
	/**
	 * returns the list of booknumbers, the modul contains
	 * @return array of integer values
	 */
	int[] getBookNumbers();	
	
	/**
	 * returns the list of books, the modul contains
	 * @return array of BibleBook objects
	 */
	BibleBook[] getBooks();
	
	/**
	 * returns all captions, that a included in this modul
	 * @return array of Caption objects
	 */	
	Caption[] getCaptions();
	
	/**
	 * get the revision number of this modul (not of the translation)
	 * @return the revision number of this modul
	 */
	String getRevision();
	
	/**
	 * returns available information about this modul and this translation
	 * @return Map of String keys and String values
	 */
	ModulInformation getInformation();
	
	/**
	 * get a Book of the Bible as an object
	 * @param bnumber
	 * @return a BibleBook object
	 */
	BibleBook getBook(int bnumber);
	
	/**
	 * returns a chapter object identified by booknumber and chapternumber
	 * @param bnumber number of the book
	 * @param cnumber number of the chapter
	 * @return a Chapter object
	 */
	Chapter getChapter(int bnumber, int cnumber);
	
	/**
	 * returns a part of the bible identified by a position object
	 * @param pos specifies the first and last vers of the requested section
	 * @return
	 */
	Document getBibleText(Position pos);
	
	/**
	 * searches all occurences of the given string in the modul 
	 * @param searchString
	 * @return the search results as an array of Position[] objects
	 */
	Position[] search(String searchString);
	
}
